import request from "@/utils/request";

//列表查询
export function list(params) {
  return request({
    url: "/agent/list",
    method: "get",
    params,
  });
}
// 新增
export function addAgent(data) {
  return request({
    url: "/agent/add",
    method: "post",
    data: data,
  });
}

//修改
export function update(data) {
  return request({
    url: "/agent/update",
    method: "post",
    data: data,
  });
}

//详情
export function detail(data) {
  return request({
    url: "/agent/detail",
    method: "post",
    data: data,
  });
}

//上传文件
export function saveFile(data) {
  return request({
    url: "/file/saveFile",
    method: "post",
    data,
  });
}

// 文件下载预览
export const queryFiles = (params) => {
  return request({
    url: "/biz/file/get",
    method: "get",
    params,
    responseType: "blob",
  });
};

// 获取文件信息
export function getSimpleFileInfo(data) {
  return request({
    url: "/biz/file/getSimpleFileInfo",
    method: "post",
    data,
  });
}

// 校验统一代码重复
export function agentcheck(data) {
  return request({
    url: "/agent/agentcheck",
    method: "post",
    data,
  });
}
